home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 19
/
Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso
/
-seriously_amiga-
/
shareware
/
workbench
/
dopus
/
webupdate
/
webupdate.dopus5
next >
Wrap
Text File
|
1997-08-18
|
3KB
|
117 lines
/* $VER: WebUpdate.dopus5 1.10 (10 JUL 97)
** by Charles Patterson <midian@azstarnet.com>
** http://www.azstarnet.com/~midian/
**
** Description: Connects to FTP site, compares web page file dates then
** uploads updated files.
**
** Requires: DirectoryOpus v5.5 (© 1996 by Jonathan Potter)
** Online with a TCP stack (no kidding :)
**
** Instructions: Set the paths and preferences below then call
** webupdate.dopus5 anyway you want to. :)
** If you don't like the idea of having your password inside
** the script, you can go down to the line below where it
** says /* Connect here */ and just delete the word "password"
**
** --- Local path for web page --- */
LISTER.0.0="DH2:Homepage/Midian/"
/* --- Remote path for web page --- */
LISTER.1.0="/users2/home/m/midian/public_html/"
/* --- Remote Host --- */
host="ftp.azstarnet.com"
/* --- Username and Password --- */
username="yourusername"
password="yourpassword"
OPTIONS RESULTS
IF ~SHOW('P',DOPUS.1) THEN ADDRESS COMMAND RUN DOPUS5:DirectoryOpus
ADDRESS DOPUS.1
DOPUS FRONT
DOPUS VERSION
IF ( result='RESULT' | TRANSLATE(result,'.',' ') < 5.1218 ) THEN DO
DOPUS REQUEST '"This script requires DOpus v5.5 or greater." OK'
EXIT
END
DOPUS SCREEN
screen=RESULT
PARSE VAR screen sinfo.0 screen
PARSE VAR screen sinfo.1 screen
IF sinfo.1 > 600 THEN DO
LISTER NEW "0/11/262/351" LISTER.0.0
END
ELSE DO
LISTER NEW "0/11/150/200" LISTER.0.0
END
LISTER.0.1=RESULT
/* Connect here */
COMMAND WAIT FTPCONNECT host username password DIR LISTER.1.0
LISTER REQUEST LISTER.0.1 '"When Remote directory '||'0a'x||'is listed click" OK'
LISTER QUERY ALL
lists=RESULT
k=0
DO WHILE lists ~= ''
PARSE VAR lists list.k lists
END
LISTER.1.1=list.k
DO n = 0 TO 1
LISTER SET LISTER.n.1 TITLE 'Listing Files'
LISTER REFRESH LISTER.n.1 FULL
LISTER SET LISTER.n.1 BUSY 1 WAIT
LISTER QUERY LISTER.n.1 FILES stem file.n
LISTER QUERY LISTER.n.1 NUMFILES
NFiles.n = RESULT
DO f = 0 TO NFiles.n
LISTER QUERY LISTER.n.1 ENTRY file.n.f stem fileinfo.n.f
END
END
DO n = 0 to 1
LISTER SET LISTER.n.1 BUSY 0
LISTER SET LISTER.n.1 TITLE 'Comparing...'
LISTER REFRESH LISTER.n.1 FULL
LISTER SET LISTER.n.1 BUSY 1 WAIT
END
filetrans=''
DO c = 0 TO (NFiles.0 - 1)
DO z = 0 TO (NFiles.1 - 1)
IF file.0.c = file.1.z THEN DO
IF fileinfo.0.c.date > fileinfo.1.z.date THEN
filetrans=filetrans file.0.c
ITERATE c
END
END
filetrans=filetrans file.0.c
END
/* Upload files */
LISTER SET LISTER.0.1 TITLE 'Uploading...'
LISTER SET LISTER.1.1 TITLE 'Receiving...'
DO n = 0 to 1
LISTER SET LISTER.n.1 BUSY 0
LISTER REFRESH LISTER.n.1 FULL
END
DO WHILE filetrans ~= ''
PARSE VAR filetrans fileup filetrans
LISTER SELECT LISTER.0.1 fileup
END
COMMAND WAIT SOURCE LISTER.0.1 DEST LISTER.1.1 COPY
LISTER REQUEST LISTER.1.1 '"Click OK when upload is finished." OK'
LISTER CLOSE LISTER.0.1
COMMAND FTPQUIT
EXIT